<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="__PUBLIC__/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style.min.css?v=4.1.0" rel="stylesheet">
</head>

<body class="gray-bg">

<div class="wrapper wrapper-content animated fadeInUp">

    <div class="row">
        <div class="col-sm-12">
            <div class="tabs-container" >
                <ul class="nav nav-tabs" id="tagTitle">
                    <li class="active">
                        <a data-toggle="tab" href="#thing" v-on:click="refresh" aria-expanded="true">寻找失物</a>
                    </li>
                    <li class="">
                        <a data-toggle="tab" href="#master" v-on:click="refresh" aria-expanded="false">寻找失主</a>
                    </li>
                    <li class="">
                        <a data-toggle="tab" href="#my" v-on:click="refresh" aria-expanded="false">我的发布</a>
                    </li>
                </ul>
                <div class="tab-content">
                    <div id="thing" class="tab-pane active">
                        <div class="ibox">
                            <div class="ibox-content">
                                <div class="row m-b-sm m-t-sm">
                                    <div class="col-md-8">
                                        <div class="form-group">
                                            <div class="input-group">
                                                <select data-placeholder="选择标签" class="chosen-select form-control" id="select1" multiple tabindex="4">
                                                    <option v-for="tags in tagName" :value="tags.Id" hassubinfo="true">{{tags.tag_name}}</option>
                                                </select>
                                                <span class="input-group-btn">
                                                    <button type="button" class="btn btn-sm btn-primary" v-on:click="search2"> 搜索</button>
                                                </span>
                                            </div>

                                        </div>
                                    </div>
                                    <div class="col-md-4">
                                        <div class="input-group">
                                            <input type="text" placeholder="请输入物品名称" v-model="searchContent" class="input-sm form-control">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-sm btn-primary" v-on:click="search"> 搜索</button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-4">
                                        <button class="btn btn-white btn-bitbucket" v-on:click="addList">
                                            我丢东西了
                                        </button>
                                    </div>
                                    <div class="col-sm-8"></div>
                                </div>
                                <div class="project-list">

                                    <table class="table table-hover" >
                                        <tbody>
                                        <tr v-for="radar in currentData" v-if="radar.thing">
                                            <td class="project-status">
                                                <span class="label label-default" v-if="radar.complete">已认领</span>

                                                <span class="label label-primary" v-if="!radar.complete">未认领</span>
                                            </td>
                                            <td class="project-title">
                                                <a href="">{{radar.title}}</a>
                                                <br/>
                                                <small>{{radar.time}}</small>
                                            </td>
                                            <td class="project-completion">
                                                <span v-if="radar.hasReward" class="label label-warning">要报酬</span>
                                            </td>
                                            <td class="project-people">
                                                <ul class="tag-list">
                                                    <li v-for="tag in radar.tags">
                                                        <a v-on:click="getByTag(tag)">{{tag}}</a>
                                                    </li>
                                                </ul>
                                            </td>
                                            <td class="project-actions">
                                                <!--TODO 增加查看详情和认领功能-->
                                                <a v-on:click="getDetail(radar.Id)" class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看详情 </a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="text-center">
                            <div class="btn-group">
                                <button class="btn btn-white" type="button" :disabled="currentPage===startPage" v-on:click="minus"><i class="fa fa-chevron-left"></i></button>
                                <button class="btn btn-white " v-on:click="jump(i)" v-for="i in pages" :class="i===currentPage?'active':''">{{i}}</button>
                                <button class="btn btn-white" type="button" :disabled="currentPage===endPage" v-on:click="add()"><i class="fa fa-chevron-right"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                    <div id="master" class="tab-pane">
                        <div class="ibox">
                            <div class="ibox-content">
                                <div class="row m-b-sm m-t-sm">
                                    <div class="col-md-8">
                                        <div class="form-group">
                                            <div class="input-group">
                                                <select data-placeholder="选择标签" class="chosen-select form-control" id="select2" multiple tabindex="4">
                                                    <option v-for="tags in tagName" :value="tags.Id" hassubinfo="true">{{tags.tag_name}}</option>
                                                </select>
                                                <span class="input-group-btn">
                                                    <button type="button" class="btn btn-sm btn-primary" v-on:click="search2"> 搜索</button>
                                                </span>
                                            </div>

                                        </div>
                                    </div>
                                    <div class="col-md-4">
                                        <div class="input-group">
                                            <input type="text" placeholder="请输入物品名称" class="input-sm form-control"> <span class="input-group-btn">
                                        <button type="button" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-sm-4">
                                        <button class="btn btn-white btn-bitbucket" v-on:click="addList">
                                            我捡到东西啦
                                        </button>
                                    </div>
                                    <div class="col-sm-8"></div>
                                </div>

                                <div class="project-list">

                                    <table class="table table-hover">
                                        <tbody>
                                        <tr v-for="radar in currentData" v-if="radar.master">
                                            <td class="project-status">
                                                <span class="label label-default" v-if="radar.complete">已找到</span>

                                                <span class="label label-primary" v-if="!radar.complete">未找到</span>
                                            </td>
                                            <td class="project-title">
                                                <a href="">{{radar.title}}</a>
                                                <br/>
                                                <small>{{radar.time}}</small>
                                            </td>

                                            <td class="project-completion">
                                                <span v-if="radar.hasReward" class="label label-warning">有悬赏</span>
                                            </td>
                                            <td class="project-people">
                                                <ul class="tag-list">
                                                    <li v-for="tag in radar.tags">
                                                        <a v-on:click="getByTag(tag)">{{tag}}</a>
                                                    </li>
                                                </ul>
                                            </td>
                                            <td class="project-actions">
                                                <!--TODO 增加查看详情和认领功能-->
                                                <a v-on:click="getDetail(radar.Id)" class="btn btn-white btn-sm"><i class="fa fa-folder"></i> 查看详情 </a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="text-center">
                            <div class="btn-group">
                                <button class="btn btn-white" type="button" :disabled="currentPage===startPage" v-on:click="minus"><i class="fa fa-chevron-left"></i></button>
                                <button class="btn btn-white " v-on:click="jump(i)" v-for="i in pages" :class="i===currentPage?'active':''">{{i}}</button>
                                <button class="btn btn-white" type="button" :disabled="currentPage===endPage" v-on:click="add()"><i class="fa fa-chevron-right"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                    <div id="my" class="tab-pane">
                        <div class="ibox">
                            <div class="ibox-content">
                                <div class="project-list">

                                    <table class="table table-hover">
                                        <tbody>
                                        <tr v-for="radar in currentData">
                                            <td class="project-status">
                                                <span class="label label-default" v-if="radar.complete">已完成</span>

                                                <span class="label label-primary" v-if="!radar.complete">未完成</span>
                                            </td>
                                            <td class="project-title">
                                                <a href="">{{radar.title}}</a>
                                                <br/>
                                                <small>{{radar.time}}</small>
                                            </td>
                                            <td class="project-completion">
                                            </td>
                                            <td class="project-people">
                                            </td>
                                            <td class="project-actions">
                                                <a v-on:click="confirm(radar.Id)" class="btn btn-white btn-sm">确认完成 </a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <div class="text-center">
                            <div class="btn-group">
                                <button class="btn btn-white" type="button" :disabled="currentPage===startPage" v-on:click="minus"><i class="fa fa-chevron-left"></i></button>
                                <button class="btn btn-white " v-on:click="jump(i)" v-for="i in pages" :class="i===currentPage?'active':''">{{i}}</button>
                                <button class="btn btn-white" type="button" :disabled="currentPage===endPage" v-on:click="add()"><i class="fa fa-chevron-right"></i>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/js/layui/layui.all.js"></script>
<script src="__PUBLIC__/js/plugins/chosen/chosen.jquery.js"></script>
<script src="__PUBLIC__/js/vue.js"></script>
<script src="__PUBLIC__/js/vue-resource.js"></script>
<script src="__PUBLIC__/js/myItem.js"></script>
</body>
</html>
